import tom.jiafei.Trangle;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        A clasA = new A();
        clasA.setB(100f);
        clasA.printB();
//        System.out.println("梯形的面积：");
        A cat = new A();
        A dog = new A();
        System.out.println("cat：");
        cat.setA(200f);
        cat.setB(400f);
        cat.printA();
        cat.printB();
        System.out.println("dog：");
        dog.setA(300f);
        dog.setB(900f);
        dog.printA();
        dog.printB();


        Trangle trangle = new Trangle();
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入三角形三条边的长度：");
        trangle.sideA = scanner.nextDouble();
        trangle.sideB = scanner.nextDouble();
        trangle.sideC = scanner.nextDouble();

        //根据用户输入情况，判断三条边能否组成三角形
        trangle.bool =(trangle.sideA + trangle.sideB > trangle.sideC) && (trangle.sideA + trangle.sideC > trangle.sideB) && (trangle.sideB + trangle.sideC > trangle.sideA)? true :  false;
        if (trangle.bool) {
            System.out.println("是一个三角形，能计算面积");
            System.out.println("面积是：" + trangle.getArea(trangle.sideA, trangle.sideB, trangle.sideC));
            System.out.println("修改三条边：");
            trangle.sideA = scanner.nextDouble();
            trangle.sideB = scanner.nextDouble();
            trangle.sideC = scanner.nextDouble();
            trangle.setLength(trangle.sideA, trangle.sideB, trangle.sideC);
        } else {
            System.out.println("不是一个三角形，不能计算面积");
        }
    }
}